<?php

namespace app\api\service;
use app\admin\model\CouponRecord;
use app\admin\model\User;
use app\common\model\Advance;
use app\common\model\CardConfig;
use app\common\model\Goodorder;
use app\common\model\Occupants;
use app\common\model\Payment;
use app\common\model\recharge\Payments;
use app\common\model\Reservations;
use app\common\model\Rooms;
use think\Db;

error_reporting(E_ERROR);
class UserService
{


    public static function car_payment($id, $uid)
    {
        $user_info = \app\common\model\User::where('id', $uid)->find();
        $Payments=\app\common\model\monthly\card\Payments::where('id','=',$id)->find();
        return \addons\epay\library\Service::submitOrder($Payments['amount'],$Payments['order_no'] , "wechat", '购买月卡', request()->domain() . '/api/notify/car_pay', "", "miniapp", $user_info['openid']);
    }


    public static function recharge_payment($id, $uid)
    {
        $user_info = \app\common\model\User::where('id', $uid)->find();
        $Payments=Payments::where('id','=',$id)->find();
        return \addons\epay\library\Service::submitOrder($Payments['recharge_amount'],$Payments['order_no'] , "wechat", '购买余额', request()->domain() . '/api/notify/recharge_pay', "", "miniapp", $user_info['openid']);
    }


}